package com.zhixiang.xaec.entity.system;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.cfg.Comment;

@Entity
@Table(name="sys_app_depuser")
@Comment("部门人员表")
public class DepUsers
{
    @Transient
    private static final Short ISMAIN = 1;
    @Transient
    private static final Short ISNOTMAIN = 0;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long depUserId;
    
    @ManyToOne(cascade = CascadeType.ALL, optional = false)
    @JoinColumn(name = "depUser_fk_s", referencedColumnName = "id")
    @Comment("人员")
    private Staff staff;
    
    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name="depUser_fk_dep", referencedColumnName="depId")
    @Comment("部门")
    private Department department;
    
    @Comment("是否主职位")
    private Short isMain;

    public Long getDepUserId()
    {
        return depUserId;
    }

    public void setDepUserId(Long depUserId)
    {
        this.depUserId = depUserId;
    }

    public Staff getStaff()
    {
        return staff;
    }

    public void setStaff(Staff staff)
    {
        this.staff = staff;
    }

    public Department getDepartment()
    {
        return department;
    }

    public void setDepartment(Department department)
    {
        this.department = department;
    }

    public Short getIsMain()
    {
        return isMain;
    }

    public void setIsMain(Short isMain)
    {
        this.isMain = isMain;
    }

    @Override
    public String toString()
    {
        return "DepUser [depUserId=" + depUserId + ", staff=" + staff + ", department="
               + department + ", isMain=" + isMain + "]";
    }
    
    
}
